package com.example.companybusiness.operationt.room;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao  //对表进行增删改查
public interface SearchBoxDao
{
    //增
    @Insert
    void insertSearchBox(SearchBox...searchBoxes);

    //删除单挑数据
    @Delete
    void deleteSearchBox(SearchBox...searchBoxes);

    //删除所有数据
    @Query("delete from SearchBox")
    void deleteAllSearchBox();

    //改
    @Update
    void updateSearchBox(SearchBox...searchBoxes);

    //查
    @Query("select * from SearchBox order by id desc")
    List<SearchBox> getAllSearchBox();
}
